import os, sys, glob

svg_files = glob.glob("*.svg")

for svg in svg_files:
   svg_base = os.path.splitext(svg)[0]
   
   for size in ["16","32","64"]:
      if size == "16":
         command = "inkscape --export-png=%s_%s.png --export-area=%s:%s:%s:%s -w %s -h %s %s"%(svg_base,size,0,0,size,size,size,size,svg)
      else:
         command = "inkscape --export-png=%s_%s.png -w %s -h %s %s"%(svg_base,size,size,size,svg)

      print command
      os.system(command)
